home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01a.txt / 000065_icon-group-sender _Fri Jun 23 08:15:13 2000.msg < prev    next >
Internet Message Format  |  2002-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11792
  4.     for icon-group-addresses; Fri, 23 Jun 2000 08:15:03 -0700 (MST)
  5. Message-Id: <200006231515.IAA11792@baskerville.CS.Arizona.EDU>
  6. Date: Fri, 23 Jun 2000 07:57:52 -0700
  7. From: Steve Wampler <swampler@noao.edu>
  8. X-Accept-Language: en
  9. To: icon-group <icon-group@optima.CS.Arizona.EDU>, jsampson@indexes.u-net.com
  10. Subject: Re: Error messages
  11. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  12. Status: RO
  13. Content-Length: 1071
  14.  
  15. "J.R. Sampson" wrote:
  16.  
  17. > I had an error message 114, 'Invalid type to subscript operation'
  18. > which I eventually traced to the fact that I had typed square
  19. > brackets where there should have been parens. However, the
  20. > phrase quoted doesn't make sense to me as it stands. What I had
  21. > done was to write, in effect, 'foo := set[bar]' - perhaps if I don't
  22. > make sense to the compiler I can't expect it to make sense to me!
  23. > It is really a syntax error.
  24.  
  25. Actually, no - it's not a syntax error.  Function names are not
  26. reserved names, but simply global variables with predefined values.
  27.  
  28. Somewhere earlier (in the execution of the program) you may have
  29. done:
  30.  
  31.     set := table()
  32.  
  33. and then the line
  34.  
  35.     foo := set[bar]
  36.  
  37. makes complete sense.  (This type of language flexibility does
  38. make it difficult to produce error messages that always make
  39. sense to the user, who may be thinking of something entirely
  40. different - which is why having a traceback that includes line
  41. numbers is so useful!)
  42.  
  43.  
  44. --
  45. Steve Wampler-  SOLIS Project, National Solar Observatory
  46. swampler@noao.edu
  47.